package com.fastloan.mgt.application.base.service.impl.third.byy;

import com.fastloan.mgt.application.base.model.ApplicationVo;
import com.fastloan.mgt.application.base.service.impl.third.ThirdApplication;
import com.fastloan.mgt.application.base.service.impl.third.byy.model.ByyApplyInfo;
import com.fastloan.mgt.customer.model.ZyCustomer;
import org.springframework.stereotype.Component;

/**
 * 班颜悦进件
 *
 * @author yanwe
 * createTime 2018-01-2018/1/11 10:54
 */
@Component
public class ByyApplication extends ThirdApplication {

    @Override
    public ApplicationVo processApplication(Object object) {
        if (!(object instanceof ByyApplyInfo)){
            return null;
        }
        ByyApplyInfo byyApplyInfo = (ByyApplyInfo) object;
        processCustomer(byyApplyInfo);
        return null;
    }

    private ZyCustomer processCustomer(ByyApplyInfo byyApplyInfo) {
        ZyCustomer customer = new ZyCustomer();
        customer.setPhoneNum(byyApplyInfo.getBorrower_contact());
        customer.setCardNum(byyApplyInfo.getBorrower_id());
        ZyCustomer criteria = new ZyCustomer();
        criteria.setCardNum(byyApplyInfo.getBorrower_id());
        ZyCustomer existCustomer = customerService.selectOne(criteria);
        if (existCustomer == null){

        } else {

        }

        return null;
    }

    @Override
    public String getAgentId() {
        return null;
    }
}
